# -*- coding:utf-8 -*-
import time
from socket import *
HOST = '220.181.111.148'
HOST = '127.0.0.1'
PORT = 9999
BUFSIZ = 1024
ADDR = (HOST, PORT)

#for i in range(1):
ts=socket(AF_INET,SOCK_STREAM)
#ts.bind((HOST, 59363))
ts.connect(ADDR)

headers='''GET / HTTP/1.1
Referer: http://www.baidu.com/

'''
headers='http'
for h in headers:
    ts.send(h)
    print h
    time.sleep(1)

#data=ts.recv(BUFSIZ)
#data1=ts.recv(BUFSIZ)
#print data
#print data1
ts.close()
#time.sleep(10000)
print 'end'



